{extend name="Public:content"}
{block name="content"}
<form class="form-horizontal m-t" id="addAuthFrom"  method="post" action="{:url('admin/auth/add')}">
    <div class="form-group">
        <label class="col-sm-2 control-label">权限名称：</label>
        <div class="col-sm-8">
            <input type="text" name="title" value='{$vo.title|default=""}' rangelength="[2,200]" required="true" placeholder="请输入权限名称" title="请输入权限名称" class="form-control">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">权限描述：</label>
        <div class="col-sm-8">
            <textarea name="desc" placeholder="请输入权限描述" required="true" title="请输入权限描述" rows="2" cols="20" class="form-control">{$vo.desc|default=""}</textarea>
        </div>
    </div>
    <div class="hr-line-dashed"></div>
    <div class="form-group">
        <div class="col-sm-12 text-center">
            {if isset($vo['id'])}<input type='hidden' value='{$vo.id}' name='id'/>{/if}
            <button class="btn btn-primary" type="submit">保存数据</button>
            <button class="btn btn-primary btn-danger" type='button' data-confirm="确定要取消编辑吗？" onclick="$.Oa.confirm(this)">取消编辑</button>
        </div>
    </div>
</form>
{/block}
{block name="script"}
<script type="text/javascript">
//表单提交
$('#addAuthFrom').validate({
    submitHandler: function(form) {
        $.Oa.doHform('#addAuthFrom',false,false,function(data){
            parent.layer.msg(data.msg);
            var iframe ='{$iframe}';
            var n = parent.$("iframe[name='"+iframe+"']").index();
            parent[n].location.reload();
            var index = parent.layer.getFrameIndex(window.name);
            parent.layer.close(index);
        })
    }
})
</script>
{/block}

